<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<style>
.editor table {
	display: inline;
	vertical-align: top;
}
</style>
<div class="r_location">
	<i class="r_txtico"></i> 内容管理&gt; 问题常见管理 &gt; 新建问题
</div>
<form id="add_form" action="cms/problem/add"   method="post">
	<ul class="all_list">
		<li>
			<span class="all_title">问题编码：</span>
			<span>
				<input class="ui_input" id="code" validator='{"label":"问题编码","required":true,"maxLength":4}' name="code" style="width:200px;">
			</span>
			<span class="all_title">排序：</span>
			<span>
				<input class="ui_input" id="showIndex"  validator='{"label":"排序","isDigit":true,"minLength":1,"maxLength":5}' name="showIndex" style="width:200px;">
			</span>
		</li>
		<li>
			<span class="all_title">问题类别：</span>
			<span>
				 <select id="category" name="category"   validator='{"label":"问题类别"}'>
					<option value="" selected="selected">请选择</option>
					<option value="新手指南">新手指南</option>
					<option value="申请问题">申请问题</option>
					<option value="材料准备">材料准备</option>
					<option value="还款问题">还款问题</option>
					<option value="其他">其他</option>
				</select>
			</span>
			<span class="all_title">是否启用：</span>
			<span>
				 <select id="status" name="status"   validator='{"label":"是否启用"}'>
					<option value="" selected="selected">请选择</option>
					<option value="1">启用</option>
					<option value="0">不启用</option>
				</select>
			</span>
		</li>
		<li class="m-t10">
			<span class="all_title">问题描述：</span>
			<span >
				<textarea rows="4" cols="98" name="description"  validator='{"label":"问题描述","required":true,"minLength":2,"maxLength":50}'    id="description_textarea"></textarea>
			</span>
		</li>
		<li class="m-t10">
			<span class="all_title">问题回复：</span>
			<span >
				<textarea rows="4" cols="98" name="answer" validator='{"label":"问题回复","required":true,"minLength":2,"maxLength":200}'  id="answer_textarea"></textarea>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span> 
				<input type="button" id="save_button" value="提 交" class="submit_btn m-r15 submitBtn">
			</span>
		</li>
	</ul>
</form>
<script type="text/javascript">
$(function(){
	$("#add_form").validator({},{
		callback:function(results){
			$('#add_form').ajaxSubmit(function(data){
				if (data.success == 'succeed') {
					to_page('/cms/problem/view/page');
				} else {
					art.dialog({icon: data.success,content: data.message,lock:true});
				}
			});
		}
	});
});
</script>